package com.lnlyj.navigation.demo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.lnlyj.navigation.LnlyjNavigationBar;

/**
 * Created by Wanglei on 2019/11/26.
 */

public class XmlActivity extends AppCompatActivity {

    TextView textView;
    LnlyjNavigationBar bar;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_xml);

        textView = findViewById(R.id.text);
        bar = findViewById(R.id.nav_bar);

        bar.addTabChangeListener(new LnlyjNavigationBar.OnTabChangeListener() {
            @Override
            public void onTabChange(int oldIndex, int newIndex) {
                textView.setText(String.format("当前选中的是第（%d）页面", (newIndex + 1)));
            }
        }, true);
    }

}
